﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MonoTouchAutoBind
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            richTextBox3.Text = "";
            MonotouchPage page = new MonotouchPage(this.richTextBox1.Text);
            this.richTextBox2.Text = page.GeneratedCode();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            DebugOut.Instance.IgnoreCodePassed += (obj, ea) => {
                richTextBox3.AppendText(ea.GeneratedCode + Environment.NewLine);
            };
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            DialogResult res= openFileDialog1.ShowDialog();
            if (res != DialogResult.OK)
            {
                return;
            }

            richTextBox1.LoadFile(openFileDialog1.FileName, RichTextBoxStreamType.PlainText);

        }

         
    }
}
